import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooModuleConfigController } from '../../../controllers';
const uctoomoduleConfigRouter = new Router();
const moduleConfigController = new uctooModuleConfigController();

uctoomoduleConfigRouter.post('/add', requireUser, moduleConfigController.add);
uctoomoduleConfigRouter.post('/edit', requireUser, rowLevelPermission('uctoo/module_config'), moduleConfigController.edit);
uctoomoduleConfigRouter.post('/del', requireUser, rowLevelPermission('uctoo/module_config'), moduleConfigController.delete);

//For getting moduleConfig with permission control
uctoomoduleConfigRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/module_config'), moduleConfigController.getSingle);
uctoomoduleConfigRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/module_config'), moduleConfigController.getMany);
uctoomoduleConfigRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/module_config'), moduleConfigController.getMany);

//#endregion AutoCreateCode
export default uctoomoduleConfigRouter;
